/**
 * 
 */
package com.zc.BankCreditManagement.ZCUtil;

/**
 * @author ZhangCheng
 * @time 2019年9月20日
 */
public class CodeProtect {
	
	public String inCode(int code) {
		GetRanNum ran = new GetRanNum();
		int temp = code<<3;
		System.out.println(temp);
		String tempString = ran.RanNum(10) + temp + ran.RanNum(5)+ran.RanNum(7);
		System.out.println(tempString);
		return tempString;
		
	}
	public String deCode(String code) {
//		String x =code;
//		String x1 = code.replace(code.substring(code.length()-12, code.length()), "");
//		String x2 = x1.replace(code.substring(0,10), "");
//		System.out.println(x1);
//		System.out.println(x2);
//		System.out.println(Integer.parseInt(x2)>>3);
		return (Integer.parseInt(code.replace(code.substring(code.length()-12, code.length()), "").replace(code.substring(0,10), ""))>>3)+"";
		
//		int temp = Integer.parseInt(code);
//		System.out.println(temp>>3);
	}
}
